import book.BookList;
import operation.IOperation;
import user.AdminUser;
import user.NormerUser;
import user.User;
import java.util.Scanner;
public class Main {
    //根据用户名字的不同确定管理员和普通用户
    public static User login() {
        System.out.println("请输入你的姓名:");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        if(name.equals("fuwanxing") || name.equals("付万星") || name.equals("fu")) {
            return new AdminUser(name);
        } else {
            return new NormerUser(name);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        while(true) {
            int choice = user.menu();
            user.doOperation(choice,bookList);
        }
    }
}
